import 'package:flutter/material.dart';

class FormPage extends StatelessWidget {
  final String youWantToShow;
  //用来接收动态传入参数
  final arguments;

  const FormPage(this.youWantToShow, {Key? key, this.arguments})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    String tmpArg =
        this.arguments != null ? arguments['id'] : " nothing put in";
    print(arguments);
    return Scaffold(
      floatingActionButton: FloatingActionButton(
        child: Text('自定义返回'),
        onPressed: () {
          Navigator.of(context).pop();
        },
      ),
      appBar: AppBar(
        title: Text('Form Page'),
      ),
      body: Text(this.youWantToShow + tmpArg),
    );
  }
}
